import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
	  //异步加载组件，用于打包后的app.js过大时至少超过1MB时才使用异步组件
      component: () =>import ('@/pages/home/Home')
    },{
      path: '/City',
      name: 'City',
      component: () =>import ('@/pages/City/City')
    },{
		//动态路由即在后面加个：id
      path: '/detail/:id',
      name: 'Detail',
      component:() =>import  ('@/pages/detail/Detail')
    }
  ],
	
	
	//看vue router中的滚动行为
	scrollBehavior (to, from, savedPosition) {
	  return { x: 0, y: 0 }
	}

})